import { getFormatterPrice } from '@const/filter'
// 主列表页--搜索项
export const indexSearchData = [
  {
    key: 'invoiceComp',
    title: '开票企业',
    type: 'input',
    attr: {
      placeholder: '请输入' // 1
    }
  },
  {
    key: 'invoiceNo',
    title: '发票编号',
    type: 'input',
    attr: {
      placeholder: '请输入' // 1
    }
  },
  {
    key: 'createTime',
    title: '创建时间',
    type: 'time',
    fieldname: ['beginDate', 'endDate'],
    attr: {
      style: 'width:270px !important;',
      class: 'daterange',
      type: 'daterange',
      'start-placeholder': '开始时间',
      'end-placeholder': '结束时间',
      'default-time': ['00:00:00', '23:59:59']
    }
  }
]
// tab切换状态
// 0为全部
export const indexTabsArr = [
  { lab: '待验票', val: 1, badge: { value: null } }, // 1
  { lab: '验票完成', val: 2, badge: { value: null } }, // 1
  { lab: '验票拒绝', val: 3, badge: { value: null } },
  { lab: '全部', val: 0, badge: { value: null } }
]

// 列表
export const columsData = [
  { type: 'index', label: '序号', width: 50, fixed: 'left' },
  { prop: 'invoiceTitle', label: '发票抬头', 'min-width': 170, 'show-overflow-tooltip': true },
  { prop: 'invoiceCode', label: '发票代码', width: 150, 'show-overflow-tooltip': true },
  { prop: 'invoiceNo', label: '发票编号', 'min-width': 170, 'show-overflow-tooltip': true },
  { prop: 'invoiceDate', label: '开票日期', 'min-width': 170, 'show-overflow-tooltip': true },
  { prop: 'invoiceAmount', label: '发票金额(元)', width: 120, formatter: row => getFormatterPrice(row.invoiceAmount) },
  { prop: 'prodAmount', label: '关联产品金额（元）', width: 150, formatter: row => getFormatterPrice(row.prodAmount) },
  { prop: 'prodTypeCount', label: '品种数', width: 100 },
  { prop: 'prodTotalCount', label: '产品总数', width: 100 },
  { prop: 'invoiceComp', label: '开票企业', width: 150, 'show-overflow-tooltip': true },
  { prop: 'createTime', label: '创建时间', width: 170 },
  { prop: 'statusName', label: '应付单状态', width: 120 },
  { prop: 'invoiceUrl', label: '发票影像', width: 120 },
  { prop: 'action', label: '操作', width: 120, fixed: 'right' }
]
// 开票详情tabs
export const detailTabs = [
  { lab: '发票', val: 1, badge: { value: null } },
  { lab: '订单明细', val: 2, badge: { value: null } }
]
// 验票页数据
export const nissinReadColunmns = [
  [
    { prop: 'invoiceTitle', span: 6, placeholder: '请输入', label: '发票抬头：', type: 'input' },
    { prop: 'invoiceCode', span: 6, placeholder: '请输入', label: '发票代码：', type: 'input' },
    { prop: 'invoiceNo', span: 6, placeholder: '请输入', label: '发票编号：', type: 'input' },
    { prop: 'invoiceAmount', span: 6, placeholder: '请输入', label: '发票金额：', type: 'input' }
  ],
  [
    { prop: 'invoiceDate', span: 6, placeholder: '请输入', label: '开票日期：', type: 'date' },
    { prop: 'drawer', span: 6, placeholder: '请输入', label: '开票人：', type: 'input' },
    { prop: 'invoiceCompany', span: 6, placeholder: '请输入', label: '开票企业：', type: 'input' },
    { prop: 'unifiedSocialCode', span: 6, placeholder: '请输入', label: '统一社会信用代码：', type: 'input' }
  ],
  [
    { prop: 'openBank', span: 6, placeholder: '请输入', label: '开户行：', type: 'input' },
    { prop: 'bankAccount', span: 6, placeholder: '请输入', label: '账号：', type: 'input' }
  ]
]
// 验票页列表数据
export const invoiceTableColumns = [
  { prop: 'platSettleCode', label: '采购单号', 'min-width': 170, 'show-overflow-tooltip': true },
  { prop: 'orderItemCode', label: '采购明细单号', 'min-width': 170, 'show-overflow-tooltip': true },
  { prop: 'prodCode', label: '产品编码', 'min-width': 150, 'show-overflow-tooltip': true },
  { prop: 'prodName', label: '产品名称', width: 170, 'show-overflow-tooltip': true },
  { prop: 'prodSpecs', label: '规格', width: 100, 'show-overflow-tooltip': true },
  { prop: 'prodModel', label: '型号', width: 100, 'show-overflow-tooltip': true },
  { prop: 'minUnit', label: '单位', width: 90 },
  { prop: 'price', label: '采购价格(元)', width: 110, formatter: row => getFormatterPrice(row.price) },
  { prop: 'udi', label: 'UDI', 'min-width': 170 },
  { prop: 'prodBatch', label: '批号', 'min-width': 100 },
  { prop: 'count', label: '数量', width: 60 },
  { prop: 'registrationNumber', label: '注册证号', 'min-width': 170 },
  { prop: 'manufacturer', label: '生产厂家', width: 170, 'show-overflow-tooltip': true },
  { prop: 'detailAmount', label: '小计金额(元)', width: 120, formatter: row => getFormatterPrice(row.detailAmount) }
  // { prop: 'taxRate', label: '税率', width: 60, formatter: row => `${row.taxRate === null ? '' : row.taxRate * 100 + '%'}` },
  // { prop: 'tax', label: '税额', width: 60 },
  // { prop: 'supplierName', label: '供应商', width: 170, 'show-overflow-tooltip': true }
]
